home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F41476_strtakeWhile.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-02-06  |  1.2 KB  |  32 lines

  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  2. exclude-result-prefixes="xsl"
  3. >
  4.   <xsl:template name="str-takeWhile">
  5.     <xsl:param name="pStr" select="/.."/>
  6.     <xsl:param name="pController" select="/.."/>
  7.     <xsl:param name="pContollerParam" select="/.."/>
  8.  
  9.     <xsl:if test="not($pController)">
  10.       <xsl:message terminate="yes">[str-takeWhile]Error: pController not specified.</xsl:message>
  11.     </xsl:if>   
  12.     
  13.         <xsl:variable name="vFirstChar" select="substring($pStr, 1, 1)"/>
  14.         <xsl:variable name="vAccept">
  15.           <xsl:apply-templates select="$pController">
  16.             <xsl:with-param name="pChar" select="$vFirstChar"/>
  17.             <xsl:with-param name="pParams" select="$pContollerParam"/>
  18.           </xsl:apply-templates>
  19.         </xsl:variable>
  20.         
  21.         <xsl:if test="string($vAccept)">
  22.            <xsl:value-of select="$vFirstChar"/>
  23.            <xsl:call-template name="str-takeWhile">
  24.               <xsl:with-param name="pStr" select="substring($pStr, 2)" />
  25.               <xsl:with-param name="pController" select="$pController"/>
  26.               <xsl:with-param name="pContollerParam" select="$pContollerParam"/>
  27.            </xsl:call-template>
  28.         </xsl:if>
  29.       
  30.   </xsl:template>
  31.  
  32. </xsl:stylesheet>